package com.example.project_demo.controller;

import com.example.project_demo.common.Result;
import com.example.project_demo.pojo.Emp;
import com.example.project_demo.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 韦红材
 * @ClassName EmpContoller
 * @data 2024/12/23 09:30
 * @Version V1.0
 **/
@RestController
@RequestMapping("/emp")
public class EmpContoller {
    @Autowired
    private EmpService empService;

    @PutMapping("/addEmpSal")
    public Result<Integer> addEmpSal(int deptno,double money){
        int update = empService.addEmpSal(deptno, money);
        return Result.success(update);
    }

    @PostMapping("/addEmp")
    public Result addEmp(@RequestBody Emp emp){
        empService.add(emp);
        return Result.success();
    }

}
